home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / reloc2.act < prev    next >
Text File  |  1995-04-22  |  2KB  |  82 lines

  1. MODULE ;RELOCATE.ACT 
  2.  
  3. ;Run-time Relocator Code. 
  4. ;For use with RELGEN.ACT 
  5. ;COPYRIGHT 1984, JS DeMar 
  6. ;Rev. 1.1, March 20,1984 
  7. ;--------------------------------- 
  8.  
  9. SET 14=$6000 
  10. SET $0491=$6000 
  11. ;--------------------------------- 
  12. ;The beginning of the relocator 
  13. ;table and code should be higher 
  14. ;than the expected end of the final 
  15. ;relocated program. But, there must 
  16. ;be enough space left for the table 
  17. ;and the relocator code itself! 
  18. ;--------------------------------- 
  19.  
  20.  
  21. ;--------------------------------- 
  22. ;Read the ".GEN" file above here. 
  23. ;--------------------------------- 
  24. ;Compile this after reading in the 
  25. ;".GEN" file above. Then append the 
  26. ;".REL" file to this code using the 
  27. ;DOS COPY command with "/A". 
  28. ;--------------------------------- 
  29.  
  30. PROC Error(BYTE err)[$6C$A] 
  31.  
  32. PROC ChkErr=*(BYTE r,b,eC)[$1610$88C0$8F0 
  33. $98$80C0$11F0 
  34. $4C Error$8A$4A4A$4A4A$98AA$9D EOF$60] 
  35.  
  36. CHAR FUNC GetD=*(BYTE d)[$7A2] 
  37. PROC CCIO=*() 
  38. [$A486$A0A$A0A$AA$A4A5$9D$342$A9$0$9D$348$9D$349 
  39. $98$20$E456$A085$4C ChkErr] 
  40.  
  41. ;--------------------------------- 
  42.  
  43. PROC BootIt=*() 
  44. ;--------------------------------- 
  45.  
  46. PROC Relocate() 
  47.  
  48. BYTE offset,memlohi=$02E8,x 
  49. CARD memlo=$02E7,i,j,top,entry 
  50. BYTE ARRAY newplace 
  51.  
  52. newplace=memlo 
  53. newplace==&$FF00 
  54. offset=memlohi 
  55. i=memlo&$00FF 
  56. IF i#0 THEN 
  57.   newplace==+$0100 
  58.   offset==+1 
  59. FI 
  60. FOR i=1 TO 6  
  61. DO 
  62.   x=GetD(1) 
  63. OD 
  64.  
  65. j=0 
  66. FOR i=start TO finish+7 
  67. DO 
  68.   x=GetD(1) 
  69.   newplace(j)=x 
  70.   j==+1 
  71. OD 
  72.  
  73. FOR i=0 TO hits-1 
  74. DO 
  75.   entry=otable(i)  
  76.   newplace(entry)==+offset 
  77. OD 
  78. runaddr==+newplace 
  79. [$6C runaddr] 
  80.  
  81.  
  82. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%